package com.zhouyu.register;

import java.util.HashMap;
import java.util.Map;

/**
 * 将接口与实现存储在Map中
 */
public class LocalRegister {

    private static Map<String, Class> map = new HashMap<>();

    /**
     * 注册
     * @param interfaceName
     * @param version
     * @param implClass
     */
    public static void regist(String interfaceName, String version, Class implClass){
        map.put(interfaceName+version, implClass);
    }

    /**
     * 获取实现类
     * @param interfaceName
     * @param version
     * @return
     */
    public static Class get(String interfaceName, String version) {
        return map.get(interfaceName+version);
    }
}
